{extend name='admin@public/content'}

{block name="content"}
<!-- 表单搜索 开始 -->
<form onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" class='form-horizontal layui-form padding-top-20'>

    <div class="form-group">
        <label class="col-sm-2 control-label">
            LotteryStatus<br><span class="nowrap color-desc">抽奖开关</span>
        </label>
        <div class='col-sm-8'>
            <!--{if $lottery_config['lottery_status'] eq 1}-->
            <label class="think-radio">
                <input checked type="radio" name="lottery_status" value="1" title="开" lay-ignore>开
            </label>
            <label class="think-radio">
                <input type="radio" name="lottery_status" value="0" title="关" lay-ignore>关
            </label>
            <!--{else}-->
            <label class="think-radio">
                <input  type="radio" name="lottery_status" value="1" title="开" lay-ignore>开
            </label>
            <label class="think-radio">
                <input checked type="radio" name="lottery_status" value="0" title="关" lay-ignore>关
            </label>
            <!--{/if}-->
            <p class="help-block">奖品描述，在微信端抽奖页面上显示</p>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">
            Description<br><span class="nowrap color-desc">奖品描述</span>
        </label>
        <div class='col-sm-8'>
            <textarea name='rule' required="required" title="请输入奖品描述" placeholder="请输入奖品描述"   class="layui-textarea" >{$lottery_config.rule}</textarea>
            <p class="help-block">奖品描述，在微信端抽奖页面上显示</p>
        </div>
    </div>


    <div class="form-group">
        <label class="col-sm-2 control-label">
            LotteryHelp<br><span class="nowrap color-desc">抽奖规则</span>
        </label>
        <div class="col-md-8">
            <textarea name='lottery_help'></textarea>
            <p class="help-block">抽奖规则，在微信端抽奖页面上显示</p>
        </div>
    </div>


    <div class="hr-line-dashed"></div>

    <div class="col-sm-4 col-sm-offset-2">
        <div class="layui-form-item text-center">
            <button class="layui-btn" type="submit">保存配置</button>
        </div>
    </div>

</form>
<!-- 表单搜索 结束 -->
{/block}

{block name='script'}
<textarea class="hide" id="lottery_help">{$lottery_config.lottery_help|default=''|raw}</textarea>
<script>
    require(['ckeditor'], function () {
        var editor;
        var editDdata = document.getElementById('lottery_help').innerHTML;
//        console.log(editDdata);
        editor = window.createEditor('[name="lottery_help"]');
        editor.setData(htmldecode(editDdata));

        //html反转义输出
        function htmldecode(string) {
            var div = document.createElement('div');
            div.innerHTML = string;
            return div.innerText || div.textContent;
        }
    });
</script>
{/block}